package com.shiyi.strategy.imp;

import com.shiyi.strategy.FileUploadStrategy;
import com.shiyi.util.COSClientUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;


@Service("txFileUploadImpl")
@RequiredArgsConstructor
public class TXFileUploadImpl implements FileUploadStrategy {
    @Override
    public String fileUpload(MultipartFile file, String suffix) {
        String s = null;
        try {
            s  = COSClientUtil.SimpleUploadFileFromLocal(false, file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    @Override
    public Boolean deleteFile(String... fileName) {
        return null;
    }
}
